package com._520it.crm.web.controller;

import com._520it.crm.domain.Organization;
import com._520it.crm.page.PageResult;
import com._520it.crm.query.OrganizationQueryObject;
import com._520it.crm.service.IOrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by 呆 on 2017/10/3.
 */
@Controller
@RequestMapping("/organization")
public class OrganizationController {
    @Autowired
    private IOrganizationService organizationService;
    @RequestMapping("")
    public String index(){
        return "organization";
    }

    @RequestMapping("/list")
    @ResponseBody
    public PageResult list(OrganizationQueryObject qo){
         return organizationService.query(qo);
    }
    @RequestMapping("/selectAll")
    @ResponseBody
    public List<Organization> selectAll( ){
        return organizationService.selectAll();
    }
    @RequestMapping("/")
    public String save(){
        return "";
    }
}
